package com.qd.common.panda.domain.entity.score;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 停车场评价记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CarParkEvaluateDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "评价ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "评价ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String eid;
    /**
     * 评价时间
     */
    private LocalDateTime addTime;
    /**
     * 分数
     */
    private Integer score;
    /**
     * 标签内容
     */
    @Size(max = 200, message = "标签内容长度不能超过{max}位", groups = DefaultGroup.class)
    private String content;
    /**
     * 用户唯一标识
     */
    @Size(max = 50, message = "用户唯一标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 车牌
     */
    @Size(max = 20, message = "车牌长度不能超过{max}位", groups = DefaultGroup.class)
    private String plateNumber;
    /**
     * 停车场
     */
    @NotBlank(message = "停车场不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "停车场长度不能超过{max}位", groups = DefaultGroup.class)
    private String parkId;
    /**
     * 停车场名称
     */
    private String parkIdDisplay;
    /**
     * 评价标签
     */
    @NotBlank(message = "评价标签不能为空", groups = DefaultGroup.class)
    private String evaluationLabel;
    /**
     * 行程ID
     */
    @NotBlank(message = "行程ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "行程ID长度不能超过{max}位", groups = DefaultGroup.class)
    @JsonProperty(value = "sid")
    private String sid;

    @Override
    public void freeData() {
        this.eid = null;
        this.addTime = null;
        this.score = null;
        this.content = null;
        this.userId = null;
        this.plateNumber = null;
        this.parkId = null;
        this.evaluationLabel = null;
        this.sid = null;
        super.freeData();
    }
}
